home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / JAVA Utilities / JProxy 1.1.0 / SAMPLES.JAR / com / jproxy / samples / rmi / test / TestImpl_Skel.java < prev    next >
Encoding:
Java Source  |  2003-04-29  |  2.4 KB  |  79 lines

  1. // Skeleton class generated by rmic, do not edit.
  2. // Contents subject to change without notice.
  3.  
  4. package com.jproxy.samples.rmi.test;
  5.  
  6. public final class TestImpl_Skel
  7.     implements java.rmi.server.Skeleton
  8. {
  9.     private static final java.rmi.server.Operation[] operations = {
  10.     new java.rmi.server.Operation("byte echoBytes(byte[])[]"),
  11.     new java.rmi.server.Operation("long getServerTime()")
  12.     };
  13.     
  14.     private static final long interfaceHash = 3274809350234753702L;
  15.     
  16.     public java.rmi.server.Operation[] getOperations() {
  17.     return (java.rmi.server.Operation[]) operations.clone();
  18.     }
  19.     
  20.     public void dispatch(java.rmi.Remote obj, java.rmi.server.RemoteCall call, int opnum, long hash)
  21.     throws java.lang.Exception
  22.     {
  23.     if (opnum < 0) {
  24.         if (hash == -3791006001307315080L) {
  25.         opnum = 0;
  26.         } else if (hash == 7800110265884817733L) {
  27.         opnum = 1;
  28.         } else {
  29.         throw new java.rmi.UnmarshalException("invalid method hash");
  30.         }
  31.     } else {
  32.         if (hash != interfaceHash)
  33.         throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch");
  34.     }
  35.     
  36.     com.jproxy.samples.rmi.test.TestImpl server = (com.jproxy.samples.rmi.test.TestImpl) obj;
  37.     switch (opnum) {
  38.     case 0: // echoBytes(byte[])
  39.     {
  40.         byte[] $param_arrayOf_byte_1;
  41.         try {
  42.         java.io.ObjectInput in = call.getInputStream();
  43.         $param_arrayOf_byte_1 = (byte[]) in.readObject();
  44.         } catch (java.io.IOException e) {
  45.         throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
  46.         } catch (java.lang.ClassNotFoundException e) {
  47.         throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
  48.         } finally {
  49.         call.releaseInputStream();
  50.         }
  51.         byte[] $result = server.echoBytes($param_arrayOf_byte_1);
  52.         try {
  53.         java.io.ObjectOutput out = call.getResultStream(true);
  54.         out.writeObject($result);
  55.         } catch (java.io.IOException e) {
  56.         throw new java.rmi.MarshalException("error marshalling return", e);
  57.         }
  58.         break;
  59.     }
  60.         
  61.     case 1: // getServerTime()
  62.     {
  63.         call.releaseInputStream();
  64.         long $result = server.getServerTime();
  65.         try {
  66.         java.io.ObjectOutput out = call.getResultStream(true);
  67.         out.writeLong($result);
  68.         } catch (java.io.IOException e) {
  69.         throw new java.rmi.MarshalException("error marshalling return", e);
  70.         }
  71.         break;
  72.     }
  73.         
  74.     default:
  75.         throw new java.rmi.UnmarshalException("invalid method number");
  76.     }
  77.     }
  78. }
  79.